Virtualization permits multiplexing of an underlying host machine between different virtual machines. The host machine allocates a certain amount of its resources to each of the virtual machines. Each virtual machine may then use the allocated resources to execute applications, including operating systems (referred to as guest operating systems (OS)). The software layer providing the virtualization is commonly referred to as a hypervisor and is also known as a virtual machine monitor (VMM), a kernel-based hypervisor, or a host operating system.
Currently, a virtual machine may access a device under the control of the host computer using three methods: device assignment, device emulation, and paravirtualization. In device assignment or pass through, a guest is granted access by a hypervisor to a device without intervention by the hypervisor or an attempt to access may be trapped by the hypervisor, but the hypervisor forwards the access requests to the device unchanged. In device emulation, a guest does not know that a hypervisor is present. The hypervisor emulates the underlying hardware of the host computer, rendering use of the virtual machine transparent to the guest operating system and the user of the computer. The guest operating system “believes” that a physical device is present and loads a virtual device driver for it, where the hypervisor traps attempted accesses to underlying physical devices and instead modifies or emulates the virtual devices of the guest and executes an appropriate command on the physical device on behalf of the guest.
In paravirtualization, the guest knows that a hypervisor is present. The guest operating system includes a module or a driver which is specific to the hypervisor. The guest detects that it is running on the hypervisor and then the hypervisor loads the specific device driver (i.e., a guest device driver). As with device emulation, with paravirtualization, accesses are interpreted by the hypervisor and executed on behalf of a guest.
Overhead is smallest and interaction fastest using device assignment with physical hardware. However, once device assignment/pass through is enabled between the guest device driver and a device, there is no easy way for the guest device driver to communicate with the hypervisor. In certain circumstances, it may be necessary for the guest device driver to request an action on the part of the hypervisor. For example, the host may control a plurality of devices that are a mixture of physical or paravirtualized devices, and it may be desirable for a guest device driver to execute an action on all of physical or paravirtualized devices at the same time. In another example, the guest device driver may need to detect a sudden or “hot” unplugging of two peripheral devices at the same time. Traditional PCI devices do not communicate or coordinate their actions with each other. In both examples, special commands are needed to permit a hypervisor to perform actions or handle interrupts on/from two or more devices simultaneously. This reintroduces complexity and additional overhead in a guest device driver, rending the advantages of assignment/pass moot.